cmake_minimum_required(VERSION 3.20)

project(v3)

# 查找源文件
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/calc SRC)

# 查找头文件
include_directories(${PROJECT_SOURCE_DIR}/include)

# 生成静态库
add_library(calc STATIC ${SRC})

# 指定生成目录
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)

# 指定可执行程序目录
set (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)

# 链接指定静态库
link_libraries(calc)

# 生成可执行程序
add_executable(v3 main.cpp)